#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

#define size 1000
int main()
{
	int N = 0;
	char ch = 0;
	scanf("%d %c", &N, &ch);

	int S[size] = { 0 };
	int term = 1;
	int i = 0;
	int left = 0;
	do
	{
		S[i] = term;
		i = i + 2;
		term = term + (2 * i - 1) * 2;
		i = i - 1;
	} while (term <= size);

	int flag = 0;
	if (N <= size)
	{
		for (i = 0; 1; i++)
		{
			if (N >= S[i] && N < S[i + 1])
			{
				left = N - S[i];
				N = S[i];
				flag = i;
				break;
			}
			else if (S[i + 1] == 0)
			{
				left = N - S[i];
				N = S[i];
				flag = i;
				break;
			}
		}
	}
	else
	{
		return 0;
	}

	int line = flag + 1;
	for (i = 1; i <= line; i++)
	{
		for (int j = 1; j < i; j++)
		{
			printf(" ");
		}
		for (int j = 1; j <= 2 * line - (2 * i - 1); j++)
		{
			printf("%c", ch);
		}
		printf("\n");
	}
	for (i = 1; i <= line - 1; i++)
	{
		for (int j = 1; j < line - i; j++)
		{
			printf(" ");
		}
		for (int j = 1; j <= 2 * i + 1; j++)
		{
			printf("%c", ch);
		}
		printf("\n");
	}
	printf("%d", left);
	return 0;
}